<template>
  <div class="cartEmpty" :class="dataName?'noBorder': ''">
    <div class="cartEmpty-cont">
      <div class="cartEmpty-img">
        <img src="https://img.wifenxiao.com/h5-wfx/images/item/shop-car/shopCar.gif" alt="">
      </div>
      <template v-if="dataName">
        <p class="cartEmpty-title">{{dataName}}还是空的</p>
      </template>
      <template v-else>
        <p class="cartEmpty-title">购物车还是空的，去逛逛吧~</p>
        <!--<p class="cartEmpty-title-child">"再忙，也要记得买点什么犒赏自己～"</p>-->
        <div class="mod_btns">
          <a @click="handleLinkTo('item-list')" class="mod_btn ljgg">
            去逛逛
          </a>
        </div>
      </template>
    </div>
  </div>
</template>

<script>
import Vue from 'vue'
  export default Vue.extend({
    name: 'index',
    props: {
      dataName: String,
      default: ''
    },
    data() {
      return {}
    },
    methods: {
      handleLinkTo(url, data) {
        this.$JumpName(this, url, data)
      }
    },
    beforeCreate() {
      document.getElementsByTagName('body')[0].classList.add('bg_white')
    },
    destroyed() {
      document.getElementsByTagName('body')[0].classList.remove('bg_white')
    }
  })
</script>

<style lang="scss">
@import 'src/styles/variables.scss';
.noBorder {
  border: none!important;
}
.cartEmpty {
  height: 948px;
  // margin-top: 10px;
  border-top:10px solid #f7f7f7;
  background-color: $default;
  display: flex;
  align-items: center;
  justify-content: center;
  &-img {
    display: block;
    text-align: center;
    img{
      width: 426px;
      height: 288px;
    }
  }
  &-title {
    text-align: center;
    padding: 10px 0;
    font-size: 32px;
    color: #666;
  }
  &-title-child {
    width: 100%;
    text-align: center;
    font-size: 22px;
    color: #999;
    margin-top: 10px;
  }
  .mod_btns {
    text-align: center;
    padding: 50px 0 30px;
    .mod_btn {
      display: inline-block;
      margin: 0 10px;
      // width: 160px;
      height: 70px;
      line-height: 70px;
      width: 200px;
      text-align: center;
      font-size: 28px;
      color: #F20B22;
      border: 2px solid #F20B22;
      border-radius: 76px;
      i {
        display: inline-block;
        margin-right: 10px;
        width: 30px;
        height: 30px;
        vertical-align: -4px;
      }
    }
  }
}
</style>
